package com.example.lvsuo.controller.cxg;


import com.example.lvsuo.entity.cxg.AdmAddresslist;
import com.example.lvsuo.modal.Result;
import com.example.lvsuo.service.cxg.IAdmAddresslistService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 通讯录 前端控制器
 * </p>
 *
 * @author 心心念念
 * @since 2021-03-30
 */
@RestController
@RequestMapping("/admAddresslist")
public class AdmAddresslistController {

    @Autowired
    IAdmAddresslistService iAdmAddresslistService;

    @GetMapping
    public Result queryadmAddresslist(String selPlusData){
        List<AdmAddresslist> addresslists = iAdmAddresslistService.queryadmAddresslist(selPlusData);
        return Result.back("ok","20000",addresslists);
    }

    @GetMapping("/{id}")
    public Result queryadmAddresslistByid(@PathVariable String id){
        AdmAddresslist byId = iAdmAddresslistService.getById(id);
        return Result.back("ok","20000",byId);
    }

}

